<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/commons/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>菜单管理</title>
	<script type="text/javascript">
		var applicationId = "${applicationId}";
	</script>
	<%@include file="/commons/resource.jsp"%>
	<script type="text/javascript" src="${ctx}/static/js/app/menu.js"></script>
</head>
<body class="easyui-layout">
	<!-- Search panel start -->
	<div class="ui-search-panel" region="north" style="height: 70px;"
		title="搜索框" data-options="striped: true,collapsible:true,iconCls:'icon-search',border:false">
		<form id="searchForm">
			<p class="ui-fields">
				<label class="ui-label">菜单名:</label> 
				<input name="menuName" class="easyui-box ui-text" style="width: 100px;">
			</p>
			<input name="parentId" type="hidden" /> 
			<a href="#" id="btn-search" class="easyui-linkbutton" iconCls="icon-search">搜索</a>
		</form>
	</div>
	<!--  Search panel end -->
	<div region="west" border="false" style="border-right: 1px solid #92B7D0; width: 210px; padding: 5px;">
		<div id="menuTrees"></div>
	</div>
	<!-- DataList  -->
	<div region="center" border="false">
		<div id="toolbar">
			<perm:hasPermission url="menu/add?applicationId=${applicationId}">
				<a href="#" class="easyui-linkbutton" iconCls="icon-add" id="addBtn" plain="true">新增</a>
			</perm:hasPermission>
			<perm:hasPermission url="menu/edit?applicationId=${applicationId}">
				<a href="#" class="easyui-linkbutton" iconCls="icon-edit" id="editBtn" plain="true">编辑</a> 
			</perm:hasPermission>
			<perm:hasPermission url="menu/delete?applicationId=${applicationId}">
				<a href="#" class="easyui-linkbutton" iconCls="icon-remove" id="deleteBtn" plain="true">删除</a>
			</perm:hasPermission>
		</div>
		<table id="data-list"></table>
	</div>

	<!-- Edit Form -->
	<div id="edit-win" class="easyui-dialog" title="菜单信息编辑页面"
		data-options="closed:true,iconCls:'icon-save',modal:true"
		style="width: 490px; height: 500px;">
		<form id="editForm" class="ui-form" method="post">
			<div class="easyui-panel" border='false'
				style="width: 450px; height: 400px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'north',split:true" style="padding: 0px 10px 20px;height:238px">
						<input class="hidden" type="text" name="menuId"> 
						<input class="hidden" type="text" name="deleted"> 
						<input class="hidden" type="text" name="menuType"> 
						<input class="hidden" type="text" name="applicationId" value="${applicationId}">
						<div class="ui-edit">
							<div class="ftitle">菜单信息</div>
							<div class="fitem">
								<label>菜单名:</label> 
								<input class="easyui-validatebox" type="text" name="menuName" data-options="required:true" maxlength="50">
							</div>
							<div class="fitem">
								<label>菜单URL:</label> 
								<input class="easyui-validatebox" type="text" name="linkUrl" maxlength="100">
							</div>
							<div class="fitem">
								<label>上级菜单:</label> 
								<input id="parentId" name="parentId" type="text" class="easyui-combotree" style="width: 160px;" required="true">
							</div>
							<div class="fitem">
								<label>权限:</label> 
								<input class="easyui-validatebox" type="text" name="permission" maxlength="50">
							</div>
							<div class="fitem">
								<label>排序:</label> 
								<input class="easyui-numberbox" type="text" name="serialNum" maxlength="3">
							</div>
							<div class="fitem">
								<label>菜单描述:</label>
								<textarea id="memo" name="menuDesc" class="e-input" style="height: 40px; width: 200px"></textarea>
							</div>
						</div>
					</div>
					<div data-options="region:'center'">  
		              	<div id="toolbar">  
					        <a href="javascript:void(0)" id='addLine_btn' class="easyui-linkbutton" iconCls="icon-add" plain="true" >新增</a>  
					        <a href="javascript:void(0)" id='addDefLine_btn' class="easyui-linkbutton" iconCls="icon-add" plain="true" >新增默认</a>
					        <a href="javascript:void(0)" id='delAllLine_btn' class="easyui-linkbutton" iconCls="icon-remove" plain="true" >删除所有</a>  
					    </div>  
					    <table id="btn-tb" style="width:100%">
					    	<thead>
						    	<tr>
						    		<th width="5%"></th>
						    		<th width="25%">操作名称:</th>
						    		<th width="35%">操作地址</th>
						    		<th width="10%">操作</th>
						    	</tr>
					    	</thead>
					    	<tbody>
					    	</tbody>
					    </table>
	            	</div>
				</div>
			</div>
		</form>
	</div>
</body>
</html>
